package com.xuecheng.content.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author: Hes
 * @description
 * @date: 2023/6/23 17:38
 */
@Api(value = "Freemarker测试",tags = "Freemarker测试")
@Controller
public class FreemarkerController {
    @GetMapping("/testfreemarker")
    @ApiOperation("Freemarker测试")
    public ModelAndView test(){
        ModelAndView modelAndView = new ModelAndView();
        //设置模型数据
        modelAndView.addObject("name","小明");
        //设置模板名称
        modelAndView.setViewName("test");
        return modelAndView;
    }

}
